package com.dingreading.cloud.admin.service.impl;

import com.dingreading.cloud.admin.entity.StoreManagementFeeImg;
import com.dingreading.cloud.admin.entity.table.StoreManagementFeeImgTableDef;
import com.dingreading.cloud.admin.mapper.StoreManagementFeeImgMapper;
import com.dingreading.cloud.admin.service.StoreManagementFeeImgService;
import com.mybatisflex.core.query.QueryCondition;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务层实现。
 *
 * @author Administrator
 * @since 2025-03-21
 */
@Service
public class StoreManagementFeeImgServiceImpl extends BaseServiceImpl<StoreManagementFeeImgMapper, StoreManagementFeeImg, StoreManagementFeeImgTableDef> implements StoreManagementFeeImgService {

    @Override
    protected StoreManagementFeeImgTableDef getTable() {
        return StoreManagementFeeImgTableDef.storeManagementFeeImg;
    }

    @Override
    public int deleteByFeeIdAndIdNot(Long id, List<Long> ids) {
        QueryCondition condition = table.feeId.eq(id)
                .and(table.id.notIn(ids));
        return getMapper().deleteByCondition(condition);
    }

    @Override
    public void deleteByFeeId(Long id) {
        getMapper().deleteByCondition(table.feeId.eq(id));
    }
}
